/*==============================================================*/
/* DBMS name:      Microsoft SQL Server 2012                    */
/* Created on:     2021/10/26 9:45:04                           */
/*==============================================================*/


if exists (select 1
            from  sysobjects
           where  id = object_id('DepartmentInfo')
            and   type = 'U')
   drop table DepartmentInfo
go

if exists (select 1
            from  sysobjects
           where  id = object_id('EmployeeInfo')
            and   type = 'U')
   drop table EmployeeInfo
go

if exists (select 1
            from  sysobjects
           where  id = object_id('UserApply')
            and   type = 'U')
   drop table UserApply
go

if exists (select 1
            from  sysobjects
           where  id = object_id('UserInfo')
            and   type = 'U')
   drop table UserInfo
go

/*==============================================================*/
/* Table: DepartmentInfo                                        */
/*==============================================================*/
create table DepartmentInfo (
   DepartmentId         int                  null,
   DepartmentName       nvarchar(50)         null,
   Competent            nvarchar(50)         null,
   Phone                nvarchar(50)         null,
   Email                nvarchar(50)         null
)
go

/*==============================================================*/
/* Table: EmployeeInfo                                          */
/*==============================================================*/
create table EmployeeInfo (
   EmId                 int                  null,
   EmName               nvarchar(50)         null,
   EmPosition           nvarchar(50)         null,
   Emphone              nvarchar(50)         null,
   EmSalary             money                null
)
go

/*==============================================================*/
/* Table: UserApply                                             */
/*==============================================================*/
create table UserApply (
   ApplyId              int                  identity,
   UserId               int                  null,
   Date                 datetime             null,
   Days                 int                  null,
   Persons              int                  null,
   ApplyAddress         nvarchar(50)         null,
   Budget               money                null,
   Sign                 nvarchar(50)         null,
   constraint PK_USERAPPLY primary key (ApplyId)
)
go

/*==============================================================*/
/* Table: UserInfo                                              */
/*==============================================================*/
create table UserInfo (
   Id                   int                  identity,
   UserName             nvarchar(50)         null,
   Count                nvarchar(50)         null,
   UserPhone            nvarchar(50)         null,
   Address              nvarchar(50)         null,
   constraint PK_USERINFO primary key (Id)
)
go

